package com.qlu.casualtalk.enums;

public enum Status {
    //注意：枚举名称必须和数据库中的值一致
    active("active"),
    inactive("inactive"),
    suspended("suspended");

    private final String value;

    Status(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    // 从字符串值获取枚举
    public static Status fromValue(String value) {
        for (Status status : values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid status value: " + value);
    }

    // 获取默认状态
    public static Status getDefault() {
        return active;
    }
}
